﻿using Cheems.Hikvision.Models;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cheems.Hikvision.Interface
{
    public interface IHikVideo : IDisposable
    {
        /// <summary>
        /// 相机登录
        /// </summary>
        /// <param name="hikVideo">相机信息</param>
        bool Login(HikVideo hikVideo);

        /// <summary>
        /// 取图并保存
        /// </summary>
        /// <param name="sJpegPicFileName"></param>
        void GetPicAndSave(string sJpegPicFileName = "HikVideoJpeg.jpg");

        /// <summary>
        /// 获取图片
        /// </summary>
        /// <param name="picSize">分配空间</param>
        /// <returns></returns>
        byte[] GetImageData(uint picSize = 5 * 1024 * 1024);

        /// <summary>
        /// 获取图片并转换为 Bitmap
        /// </summary>
        /// <param name="picSize">分配空间</param>
        /// <returns></returns>
        Bitmap GetImageAsBitmap(uint picSize = 5 * 1024 * 1024);

        /// <summary>
        /// 打开取流
        /// </summary>
        void OpenStreaming();

        /// <summary>
        /// 接收到单帧图，必须打开取流
        /// </summary>
        event Action<HikVideo, Bitmap> OnReceiveSingleFrame;

        /// <summary>
        /// SDK报错误码
        /// </summary>
        event Action<HikVideo, uint> OnSDKException;
    }
}
